<template>
  <div class="remarks-style">
    <div
      class="remarks-style-content"
      :style="{
        backgroundImage: `url(${publicUrls + 'free/style14/popup-windowBg.webp'})`,
      }"
    >
      <div class="close-box" @click="store.setChildRemarksShow(false)">
        <span class="iconfonts">&#xe60e;</span>
      </div>
      <img class="top-left icons" :src="publicUrls + 'free/style14/popup-windowIcon.png'" alt="" />
      <img class="top-right icons" :src="publicUrls + 'free/style14/popup-windowIcon.png'" alt="" />
      <img class="bottom-left icons" :src="publicUrls + 'free/style14/popup-windowIcon.png'" alt="" />
      <img class="bottom-right icons" :src="publicUrls + 'free/style14/popup-windowIcon.png'" alt="" />
      <div class="content-box">
        <div class="title-center" v-if="store.childTitle">
          {{ store.childTitle }}
        </div>
        <div class="sub-title" v-if="store.childSubTitle">{{ store.childSubTitle }}</div>
        <div class="bottom-box">
          <scrollBox
            color="rgba(51, 51, 51, 1)"
            v-if="Scrollheights && store.childRemarksShow"
            :remarks="store.childRemarks"
            :byid="100"
            :isTop="true"
            :height="getScrollWComputed"
            :scroll-src="publicUrls + 'free/style14/scrollIcon.png'"
          >
            <template #solidBorder>
              <div class="solidBorder-child"></div>
            </template>
          </scrollBox>
        </div>
      </div>
    </div>
  </div>
</template>

<script lang="ts">
export default defineComponent({
  name: 'style14',
});
</script>
<script lang="ts" setup>
import { getMobileType } from '@/utils/getMoble';
import { publicUrls } from '@/utils/minxin';
import scrollBox from '../scrollBox.vue';
import { useProjectStore } from '@/store';
import { ref, computed, defineComponent } from 'vue';

const isMobile = ref(false);
isMobile.value = getMobileType();
const store = useProjectStore();
let viewportHeight = window.innerHeight;
const Scrollheights = ref();
Scrollheights.value = (viewportHeight / 900) * 460;
const getScrollWComputed = computed(() => {
  let rootNode = document.documentElement;

  // 获取计算后的样式
  let computedStyle = window.getComputedStyle(rootNode);

  // 读取字体大小（注意这里返回的可能是一个包含单位的字符串，如"16px"）
  let fontSize = computedStyle.fontSize;

  // 如果你需要一个数字值（不带单位）进行计算，你可能需要解析这个字符串
  // 例如，使用正则表达式或split()方法去除单位，并将结果转换为数字
  let fontSizeNumber = parseFloat(fontSize.replace(/[^0-9.-]/g, ''));

  let heights = (fontSizeNumber / 144) * 460;
  if (isMobile.value) {
    heights = (fontSizeNumber / 144) * 398;
  }
  return heights;
});
const getTabmComputed = computed(() => {
  let rootNode = document.documentElement;

  // 获取计算后的样式
  let computedStyle = window.getComputedStyle(rootNode);

  // 读取字体大小（注意这里返回的可能是一个包含单位的字符串，如"16px"）
  let fontSize = computedStyle.fontSize;

  // 如果你需要一个数字值（不带单位）进行计算，你可能需要解析这个字符串
  // 例如，使用正则表达式或split()方法去除单位，并将结果转换为数字
  let fontSizeNumber = parseFloat(fontSize.replace(/[^0-9.-]/g, ''));
  let heights = (fontSizeNumber / 144) * 98;
  return heights;
});
</script>

<style lang="less" scoped>
.remarks-style {
  display: flex;
  flex-direction: column;
  position: relative;
  //   width: 100%;
  //   max-width: 1200px;
  width: 1200px;
  height: 750px;
  background: transparent;
  transform: translateZ(0px);
}
.remarks-style-content {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  background-repeat: no-repeat;
  background-size: 100% 100%;
}
.close-box {
  cursor: pointer;
  position: absolute;
  top: 0;
  right: -10px;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  .iconfonts {
    font-size: 28px;
    color: #d4bb8f;
    flex-shrink: 0;
  }
}
.icons {
  position: absolute;
  width: 14px;
  height: 14px;
  object-fit: cover;
}
.top-left {
  top: 36px;
  left: 34px;
  transform: rotate(-90deg);
}
.top-right {
  top: 36px;
  right: 34px;
}
.bottom-left {
  bottom: 34px;
  left: 35px;
  transform: rotate(180deg);
}
.bottom-right {
  bottom: 34px;
  right: 35px;
  transform: rotate(90deg);
}
.content-box {
  width: 100%;
  height: 620px;
  flex-shrink: 0;
  padding: 10px 100px 18px 100px;
}
.title-center {
  color: #fff;
  font-family: 'SourceHanSerifCN';
  font-size: 32px;
  font-style: normal;
  font-weight: 700;
  line-height: 160%; /* 51.2px */
}
.sub-title {
  color: #fff;
  margin-top: 15px;
  /* 一级副标 */
  font-family: 'SourceHanSerifCN';
  font-size: 18px;
  font-style: normal;
  font-weight: 500;
  line-height: 28px; /* 155.556% */
}
.bottom-box {
  margin-top: 36px;
}
.solidBorder-child {
  width: 2px;
  height: 456px;
  flex-shrink: 0;
  background: #113bac;
}
::v-deep .unit-exbi-remarks-info-remarks {
  width: 100%;
  p {
    color: #fff;
    text-align: justify;
    font-family: 'PingFang SC' !important;
    font-size: 16px !important;
    font-style: normal;
    font-weight: 400 !important;
    line-height: 32px !important; /* 200% */
  }
}
::v-deep .solid-box-parent {
  position: absolute;
  right: -80px;
  img {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    margin-top: 2px;
  }
}
::v-deep .templatestyle1-scroll-box-tumb {
  display: flex;
  align-items: flex-start;
  justify-content: center;
}
::v-deep .unit-exbit-null-remarks-info {
}
</style>
